Обновить

How to raise your i2p site (eepsite) on VDS (VPS) under Ubuntu (LAMP). Brief instructions for beginners

Время на прочтение 4 min
Количество просмотров 11K
Background: Recently a book was written regarding the new political system (Domain State), which awaits us in the near future. And since Roskomnadzor reacts inadequately to such things, I decided to create a website for my writings on the private i2p network. In the process of creation, I had to solve some technical issues, which I will consider below, trying to save your time, at the same time I will also have a cheat sheet.

So, I have a remote VPS for Ubuntu, and I need to host the site on it. Because, of course, you can do it on your laptop, but when the laptop is turned off, the site is inaccessible (personally, this invariably annoys me in .i2p and .onion).

Next, I assume that your LAMP is already configured and normally sends content to the regular Internet. Those. you already have a couple of regular (non-i2p) sites running on it.

First install i2p on Ubuntu:

sudo apt-add-repository ppa:i2p-maintainers/i2p
sudo apt-get update
sudo apt-get install i2p

Configuring the i2p router as a constantly running daemon:

sudo dpkg-reconfigure -plow i2p

During configuration (via the graphical interface) you will need to answer a few simple questions, set autorun, I left the memory at the default 128 MB, in general, I think you won’t have any problems with this.

Once configuration is complete, the i2p daemon will start on its own.

Now we need the panel with the web interface of the i2p router to be accessible remotely. To do this, open the file

/var/lib/i2p/i2p-config/clients.config

And we change it

clientApp.0.args=7657 ::1,127.0.0.1 ./webapps/

on

clientApp.0.args=7657 80.80.80.80 ./webapps/

Where instead

80.80.80.80

Set the external IP of your VPS. There is another option (from the i2p developers) where you can replace with:

clientApp.0.args=7657 0.0.0.0 ./webapps/

but I haven't tried it.

Now you have access to a web interface for managing your remote i2p router.

FIRST THING you go to:

http://80.80.80.80:7657/configui

(instead of 80.80.80.80, substitute the IP of your VPS) and set a login password (so that no one gets stolen). Now only you have access to the web console (well, I hope so).

The manual recommends: «Go to localhost:7657/index.jsp and click on Soft Restart, this will restart the JVM and all applications». Do it. Don't forget to substitute the IP of your VPS instead of localhost.

Now here's the problem with i2p under Ubuntu 16.04: in the left panel of the web console you will see the message:
Please note: ECDSA is not available. Update Java or OS.

This is due to the fact that Ubuntu 16.04 uses... well, you need to install another Java, stable one. I chose the option from Oracle.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

and onwards:

sudo update-java-alternatives -s java-8-oracle

Now all you have to do is create a new HTTP tunnel to your site. You can do this here:

http://80.80.80.80:7657/i2ptunnelmgr

(Just change the IP)

Select “New open service”» — http (is the default) and click “Create”. In field
Access Point: Address(H):

Specify the IP of your VPS. Specify the port on which the server is running (say, apache2, usually 80 or 8080), and in the field:
Website name(W):

You write something like:

moysite.i2p

Check the box for autorun. Change at will Name(N) And Description(e).
Don't touch the rest. Click on “Save».

Voila! Now your site is visible using a 32-bit key address (like this: pqajparec44p74uvpxvxhpd5u3neuqs2t4awwd6bcieku3juhwwa.b32.i2p ) in i2p network. And if you add your site to the address books of various services, for example, here: stats.i2p, then over time your domain name will moysite.i2p, which you specified earlier will be included in the address books of other services. And your site will be found directly by this name, or through jump services.
But if my server serves multiple virtualhosts on the same socket, how do I know which domain will be visible on the i2p network?

That's a good question. In general, I also tested the installation on a working server with virtual hosts and resolved the issue this way: I assigned a different port to the site for i2p (which we specified earlier when creating the tunnel). Let's do this together. Opening:

/etc/apache2/ports.conf

And write there:

Listen 8088

For example, let's say this is the port number 8088.

To another config:

/etc/apache2/sites-enabled/000-default.conf

You write something like:

<VirtualHost *:8088>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/moysite
	ErrorLog ${APACHE_LOG_DIR}/error8088.log
	CustomLog ${APACHE_LOG_DIR}/access8088.log combined
</VirtualHost>

(be sure to close the tag VirtualHost — on Habré there is a glitch with the display of this piece of code)

DocumentRoot Of course, change the path to the real one, to the one where you actually have the folder DocumentRoot for your i2p site. If there is no such thing, create one. Save everything. Restart Apache:

sudo service apache2 restart

If you don’t want your i2p site to be visible from the regular Internet, put it in the DocumentRoot directory .htaccess following contents:

Order deny,allow
Deny from all
Allow from 80.80.80.80

80.80.80.80 – change to the IP of your VDS.

Go to stats.i2p and add your site to the local service.

After adding, your site becomes accessible, for example, like this:

stats.i2p/cgi-bin/jump.cgi?a=r.i2p

(this is the website address that I made)

And yes, in general, it is more logical not to host an i2p site on a working VPS. It's better to take something separate for i2p. Well, that's how I see it.

If there is additional questions about installation - welcome to comments.

Links to used docs:

geti2p.net/ru/faq
help.ubuntu.ru/wiki/i2p
help.ubuntu.ru/wiki/java
Tags:
Hubs:
Всего голосов 13: ↑11 и ↓2 +9
Комментарии 15
+15

Comments 15

Because, of course, you can do it on your laptop, but when the laptop is turned off, the site is inaccessible (personally, this invariably annoys me in .i2p and .onion).


Make a website on ZeroNet, no? True, we don’t know how dynamic sites (LAMP) will work there
First time I heard it. Googled it. Interesting. Perhaps after testing I’ll write something similar about creating a site in ZeroNet :)

Thank you.
Toad and Apache?
Yes, you are a noble sophisticate.
i2pd and nginx to help you
https://i2pd.readthedocs.io/en/latest/tutorials/http/#host-anonymous-website
All i2pd settings
Put in your ~/.i2pd/tunnels.conf file:
[anon-website]
type = http
host = 127.0.0.1
port = 8080
keys = anon-website.dat

Well, a monkey can set up nginx, I won’t even give links.
positive person )

Thank you.
It’s just that i2pd is still less voracious, because it’s C++, not Java, so it’s better to use it. And there are fewer dances with him, as we see from the docks. If I’m not confusing anything, then the author of i2pd lives somewhere here on Habré, but I don’t immediately remember his nickname, maybe he’ll see a topic about i2p and come and explain why i2pd is better than the Java implementation.

UPD: original — by i2pd, I found it!
Mercy, I'll definitely try it!)
Installed according to this manual: https://habrahabr.ru/post/275643/ - a lot of warnings at the make stage and crashed with allocated memory (on a fresh VPS with 1 gig of RAM).
I tried to install from a .deb package, but the same thing happened. Can't open some file or other crap. Then I spent another half hour cleaning this crap from the system (it scattered itself into different folders :)
Probably, if you understand this well and have a free day or two, you can configure it somehow, but you don’t really want to.
Why couldn’t it be possible to do apt-get install i2pd and have it work immediately, as in this subject?
Various books and files can also be distributed via IPFS (ipfs.io)
Thanks for the tip )

It's a very bad idea to open the i2p web interface this way.:
http://xxxnx:7657/configui


  1. The password will be transmitted in clear text via http.
  2. The fact of connection from your IP to port 7657 i2p nodes will be seen and recorded in the log by all and sundry.

Blocking such things via .htaccess is also a mediocre idea. It is more advisable to write an iptables rule that will prohibit connections to 8088 for everyone except 127.0.0.1

Thank you!
By the way, what do you offer as an alternative to the web interface? Configs edit?
Access it in a more secure way. For example, via an ssh tunnel or OpenVPN. Or via https (in nginx this is called proxy_pass, when your browser connects to nginx on your VPS via https (even with a self-signed certificate) and it already connects to port 7657 of the i2p process via http). Great choice…
Sounds reasonable, yes. It’s also possible via Tor, in theory... In general, there really is a choice :) Thank you.
Only full-fledged users can leave comments. Sign in, Please.